#ifndef __WIZ_ARCHIVE_OUTPUT_HPP__SHANHAOBO_19800429__
#define __WIZ_ARCHIVE_OUTPUT_HPP__SHANHAOBO_19800429__

#include "../../../Include/Core/Archive/WizArchive.hpp"

#include "../../../Include/Core/Accessor/WizAccessor.hpp"

namespace Wiz
{
    namespace Archive
    {
        namespace Output
        {
            struct WIZ_PRIVATE Type : public ::Wiz::Archive::Type
            {
                WIZ_DECLARE_CLASS_THIS(Type);

                Type(::Wiz::Accessor::Ptr APtr, ::Wiz::Bool::In DA = ::Wiz::Bool::False) : m_AccessorPtr(APtr), m_DestoryAccessor()
                {
                }
                ~Type()
                {
                    if (m_DestoryAccessor && ::Wiz::IsValidPtr(m_AccessorPtr))
                    {
                        ::Wiz::Accessor::Destory(m_AccessorPtr);
                    }
                    m_AccessorPtr = WIZ_NULLPTR;
                }
                ::Wiz::Accessor::Ptr        m_AccessorPtr;
                ::Wiz::Bool::Type           m_DestoryAccessor;

                ///===================================///
                virtual ::Wiz::USize32::Type CurrPos()
                {
                    return m_AccessorPtr->CurrentPosition();
                }
                virtual ::Wiz::Void::Type  MoveTo(::Wiz::USize32::In InPos)
                {
                    return m_AccessorPtr->MoveTo(InPos);
                }
                ///===================================///
                virtual tThisRef operator&&(::Wiz::Boolean8::InOut IOData)
                {
                    m_AccessorPtr->WriteAndAdvance(IOData);
                    return *this;
                }
                virtual tThisRef operator&&(::Wiz::Boolean16::InOut IOData)
                {
                    m_AccessorPtr->WriteAndAdvance(IOData);
                    return *this;
                }
                virtual tThisRef operator&&(::Wiz::Boolean32::InOut IOData)
                {
                    m_AccessorPtr->WriteAndAdvance(IOData);
                    return *this;
                }
                virtual tThisRef operator&&(::Wiz::Boolean64::InOut IOData)
                {
                    m_AccessorPtr->WriteAndAdvance(IOData);
                    return *this;
                }

                virtual tThisRef operator&&(::Wiz::Int8::InOut IOData)
                {
                    m_AccessorPtr->WriteAndAdvance(IOData);
                    return *this;
                }
                virtual tThisRef operator&&(::Wiz::Int16::InOut IOData)
                {
                    m_AccessorPtr->WriteAndAdvance(IOData);
                    return *this;
                }
                virtual tThisRef operator&&(::Wiz::Int32::InOut IOData)
                {
                    m_AccessorPtr->WriteAndAdvance(IOData);
                    return *this;
                }
                virtual tThisRef operator&&(::Wiz::Int64::InOut IOData)
                {
                    m_AccessorPtr->WriteAndAdvance(IOData);
                    return *this;
                }

                virtual tThisRef operator&&(::Wiz::UInt8::InOut IOData)
                {
                    m_AccessorPtr->WriteAndAdvance(IOData);
                    return *this;
                }
                virtual tThisRef operator&&(::Wiz::UInt16::InOut IOData)
                {
                    m_AccessorPtr->WriteAndAdvance(IOData);
                    return *this;
                }
                virtual tThisRef operator&&(::Wiz::UInt32::InOut IOData)
                {
                    m_AccessorPtr->WriteAndAdvance(IOData);
                    return *this;
                }
                virtual tThisRef operator&&(::Wiz::UInt64::InOut IOData)
                {
                    m_AccessorPtr->WriteAndAdvance(IOData);
                    return *this;
                }

                virtual tThisRef operator&&(::Wiz::Real16::InOut IOData)
                {
                    m_AccessorPtr->WriteAndAdvance(IOData);
                    return *this;
                }
                virtual tThisRef operator&&(::Wiz::Real32::InOut IOData)
                {
                    m_AccessorPtr->WriteAndAdvance(IOData);
                    return *this;
                }
                virtual tThisRef operator&&(::Wiz::Real64::InOut IOData)
                {
                    m_AccessorPtr->WriteAndAdvance(IOData);
                    return *this;
                }
                ///===================================///

                virtual tThisRef operator&&(::Wiz::String::InOut IOData)
                {
                    m_AccessorPtr->WriteAndAdvance(IOData);
                    return *this;
                }

                virtual tThisRef operator&&(::Wiz::WString::InOut IOData)
                {
                    m_AccessorPtr->WriteAndAdvance(IOData);
                    return *this;
                }

                virtual tThisRef operator&&(::Wiz::UTF8::String::InOut IOData)
                {
                    m_AccessorPtr->WriteAndAdvance(IOData);
                    return *this;
                }
                virtual tThisRef operator&&(::Wiz::UTF16::String::InOut IOData)
                {
                    m_AccessorPtr->WriteAndAdvance(IOData);
                    return *this;
                }
                virtual tThisRef operator&&(::Wiz::UTF32::String::InOut IOData)
                {
                    m_AccessorPtr->WriteAndAdvance(IOData);
                    return *this;
                }
                ///===================================///


                virtual tThisRef operator&&(::Wiz::Byte::Ptr &IOData)
                {
                    m_AccessorPtr->WriteAndAdvance(IOData);
                    return *this;
                }
            };
        } /// end of namespace Output
    } /// end of namespace Archive
} /// end of namespace Wiz

#endif /*__WIZ_ARCHIVE_OUTPUT_HPP__SHANHAOBO_19800429__*/
